import {post_json,get,post} from '../../http/axios'
export default {
    namespaced:true,
    state:{
        user:{}
    },
    getters:{},
    mutations:{
        serUser(state,data){
            state.user = data
            console.log(state.user)
        },

    },
    actions:{
        async uploadUser(context,params){
            return await get('/user/realname?user_id='+params)
        },
        async findUser(context,params){
            let res = await get('/waiter/findWaiterById?id='+params)
            context.commit('serUser',res.data)
        },
        async saveUser(context,params){
            let res = await post('/waiter/saveOrUpdate',params)
        }
    }
}